package com.hyt.it.ogt.kq.common.bm.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 报名支付流水状态
 * @Description
 */
@Getter
public enum BmPayBusinessFlowType {
	PAY_WAITTING("10", "待支付"),
	PAY_PEDDING("11", "支付中"),
	PAY_SUCCESS("12", "支付成功"),
	PAY_FAIL("13", "支付失败"),
	REFUND_APPLY("20", "退款申请中"),
	REFUND_PEDDING("21", "退款中"),
	REFUND_SUCCESS("22", "退款成功"),
	REFUND_FAIL("23", "退款失败");

    private String businessType;
    private String msg;


    BmPayBusinessFlowType(String businessType, String msg) {
        this.businessType = businessType;
        this.msg = msg;
    }
    
    
    public static String getPayDesc(String businessType) {
    	String payDesc = "";
        if(StringUtils.isEmpty(businessType)) {
        	return null;
        }
        if(businessType.equals(PAY_WAITTING.getBusinessType())
            	|| businessType.equals(PAY_SUCCESS.getBusinessType())
            	|| businessType.equals(PAY_FAIL.getBusinessType())){
        	payDesc = "缴费";
        }
        
        if(businessType.equals(REFUND_APPLY.getBusinessType()) || businessType.equals(REFUND_PEDDING.getBusinessType())
            	|| businessType.equals(REFUND_SUCCESS.getBusinessType())
            	|| businessType.equals(REFUND_FAIL.getBusinessType())){
        	payDesc = "退费";
        }
        return payDesc;
    }
    
    public static String getMsg(String businessType) {
    	String msg = "";
        if(StringUtils.isEmpty(businessType)) {
        	return msg;
        }
        for (BmPayBusinessFlowType bmPayBusinessFlowType : BmPayBusinessFlowType.values()) {
			if(bmPayBusinessFlowType.getBusinessType().equals(businessType)) {
				return bmPayBusinessFlowType.getMsg();
			}
		}
        return msg;
    }
}
